// 图片列表
controllers.controller('operateFlowListCtrl', ['$scope', '$http', '$rootScope', '$modal', '$window', 'System', 'AlertService',
    function ($scope, $http, $rootScope, $modal, $window, System, AlertService) {

        $scope.resetCurrentPageName("系统维护");
        $scope.utils = Food.utils;
        $scope.operateFlowList = System.operateFlowList = [];
        $scope.operateFlow = {};
        $scope.totalCount = System.totalCount;

        $scope.queryList = function () {
            System.getOperateFlowList($scope.operateFlow, function () {
                $scope.totalCount = System.totalCount;
            });
        };
        $scope.queryList();

        var operateTemplate = "<button class='btn btn-primary btn-sm' ng-click='grid.appScope.initUpdateItem(row.entity)'>修改</button>" +
            "<button class='btn btn-primary btn-sm' ng-click='grid.appScope.downItem(row.entity.id)'>下架</button>";

        $scope.gridOptions = {
            data: 'operateFlowList',
            enableColumnMenus: false,
            enableColumnResizing: true,
            columnDefs: [
                {field: 'operateId', displayName: '操作者Id'},
                {field: 'operateMsg', displayName: '操作行为'},
                {field: 'operateType', displayName: '操作类型'},
                {field: 'gmtCreate', displayName: '操作时间', cellFilter: "date:'yyyy-MM-dd hh:mm:ss'"},

                {
                    field: 'id',
                    displayName: '操作',
                    width: "10%",
                    cellTemplate: operateTemplate
                }
            ]
        };

    }]);

